﻿@using Microsoft.AspNetCore.Components.Routing
@using ThingsGateway.Admin.Application
@using ThingsGateway.Server
@namespace ThingsGateway.Server

@{
    #if NET6_0
}
<Microsoft.AspNetCore.Components.Authorization.CascadingAuthenticationState>

<Router AppAssembly="@typeof(Routes).Assembly" AdditionalAssemblies="App.RazorAssemblies.Where(a=>a!=typeof(Routes).Assembly)">
<Found Context="routeData">

    <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />

</Found>
<NotFound>
    <LayoutView Layout="@typeof(BaseLayout)">
    <NotFound404></NotFound404>
        </LayoutView>
    </NotFound>
</Router>


</Microsoft.AspNetCore.Components.Authorization.CascadingAuthenticationState>


@{
    #else
}
<Router AppAssembly="@typeof(Routes).Assembly" AdditionalAssemblies="App.RazorAssemblies.Where(a=>a!=typeof(Routes).Assembly)">
<Found Context="routeData">

    <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />


</Found>
<NotFound>
    <LayoutView Layout="@typeof(Razor.BaseLayout)">
    <NotFound404></NotFound404>
        </LayoutView>
    </NotFound>
</Router>

@{
    #endif
}

